package com.example;

import android.util.Base64;

/**
 * Created by jsb-cpyy on 2017/9/13.
 */

public class Base64Demo {

    public static void main(String[] atgs) {
        String str = "1231a";
        String encodeToString = Base64.encodeToString(str.getBytes(), Base64.DEFAULT);
        System.out.println(encodeToString);
        String decodedString =new String(Base64.decode(encodeToString,Base64.DEFAULT));
        System.out.println(decodedString);
    }
}
